<template>
<div style="margin: 0;padding: 0">
  <el-container>
    <!--页面表头设计-->
    <el-header style="height: 7vh" >
      <el-link class="headMain" href="http://10.255.96.48:3404/">俄动力质量管理系统</el-link>
      <span class="center-text">控制计划管理</span>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <div>
          <el-link type="primary" @click="addOp(1)">增加工序</el-link>&nbsp;&nbsp;&nbsp;
          <el-link type="primary" @click="addOp(2)">增加产品</el-link>
        </div>
        <div style="margin-top: 10px">
          <UseTree :data1="TreeList" @TreeClick.passive="TreeClick" style="height: 300px"></UseTree>
        </div>
      </el-aside>
      <el-container>
        <!--主体设计-->
      <el-main>
        <div style="height: 100%">
          <el-table
              :data="tableData"
              style="width: 100%"
              height="100%"
              size="mediut">
            <el-table-column
                :prop="operation"
                label="过程名称/操作描述"
                width="150">
            </el-table-column>
            <el-table-column
                :prop="device"
                label="机器、装置、夹具、工装"
                width="150">
            </el-table-column>
            <el-table-column label="特性">
              <el-table-column
                  :prop="numberOrder"
                  label="编号"
                  width="120">
              </el-table-column>
              <el-table-column
                  :prop="product"
                  label="产品"
                  width="120">
              </el-table-column>
              <el-table-column
                  :prop="processUse"
                  label="过程"
                  width="120">
              </el-table-column>
            </el-table-column>
            <el-table-column
                prop="characteristic"
                label="特殊特性分类"
                width="120">
            </el-table-column>
            <el-table-column
                label="方法"
                style="text-align: center"
                >
              <el-table-column
                label="产品/过程规范/公差"
                width="250px"
                :prop="specification"
                fixed></el-table-column>
              <el-table-column
              label="评价/测量技术"
              width="100px"
              :prop="measure"></el-table-column>
              <el-table-column
                  label="容量"
                  width="100px"
                  :prop="capacity"></el-table-column>
              <el-table-column
                  label="频率"
                  width="100px"
                  :prop="frequency"></el-table-column>
              <el-table-column
                  label="控制方法"
                  width="100px"
                  :prop="method"></el-table-column>
              <el-table-column
                  label="责任部门"
                  width="100px"
                  v-slot:default="scope">
                <el-link v-if="languageS==='chinese'">{{scope.row.department.split('/')[0]}}</el-link>
                <el-link v-if="languageS==='english'">{{scope.row.department.split('/')[1]}}</el-link>
                <el-link v-if="languageS==='russian'">{{scope.row.department.split('/')[2]}}</el-link>
              </el-table-column>
            </el-table-column>
            <el-table-column
                label="反应计划"
                width="100px"
                prop="reaction"></el-table-column>
            <el-table-column label="编辑" width="220px" v-slot:default="scope">
              <el-link type="primary" @click="handleEdit(scope,1)">编辑&nbsp;&nbsp;</el-link>
              <el-link type="primary" @click="handleEdit(scope,2)">删除&nbsp;&nbsp;</el-link>
              <el-link type="primary" @click="handleEdit(scope,3)">向下插入&nbsp;&nbsp;</el-link>
              <el-link type="primary" @click="handleEdit(scope,4)">向上插入</el-link>
            </el-table-column>
            <el-table-column label="频次检测" width="90px" v-slot:default="scopeTesting">
              <span v-if="tableData[0].reaction!==0 || tableData.length>1">启用</span>&nbsp;&nbsp;
              <el-link type="primary" @click="testing(scopeTesting,1)" v-if="scopeTesting.row.product!=='请输入'">编辑</el-link>
            </el-table-column>

          </el-table>
        </div>
      </el-main>

        <!--底部的内容-->
        <el-footer>
          <el-button plain size="small" @click="languageSelectChinese">中  文</el-button>
          <el-button plain size="small" @click="languageSelectRussian">Русский язык</el-button>
          <el-button plain size="small" @click="languageSelectEnglish">English</el-button>
        </el-footer>
      </el-container>
    </el-container>
  </el-container>


<!--对控制计划内容进行增删改操作的弹窗-->
  <el-dialog
      :title="titleMessage"
      :visible.sync="dialogVisible"
      width="80%"
      :before-close="handleClose">
    <span>
      <!--放置修改的表单-->
      <el-form :inline="true" :model="tableDataTemp" status-icon :rules="tableDataTemprules" ref="tableDataTemp" class="demo-form-inline" >
        <div class="UploadS">
         <el-form-item label="零件/过程编号">

          <el-input v-model="tableDataTemp.processNumber"
                    placeholder="零件/过程编号"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
         <el-form-item label="(English)">
          <el-input v-model="tableDataTemp.processNumberEnglish"
                    placeholder="零件/过程编号(English)"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
         <el-form-item label="(Russian)">
          <el-input v-model="tableDataTemp.processNumberRussian"
                    placeholder="(Russian)"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
          <br>
        <el-form-item label="过程名称/操作描述">
          <el-input v-model="tableDataTemp.operation"
                    placeholder="过程名称/操作描述"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(English)">
          <el-input v-model="tableDataTemp.operationEnglish"
                    placeholder="(English)"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(Russian)">
          <el-input v-model="tableDataTemp.operationRussian"
                    placeholder="(Russian)"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
          <br>
        <el-form-item label="机器、夹具、装置、工装">
          <el-input v-model="tableDataTemp.device"
                    placeholder="机器、夹具、装置、工装"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="（English）">
          <el-input v-model="tableDataTemp.deviceEnglish"
                    placeholder="(English）"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="（Russian）">
          <el-input v-model="tableDataTemp.deviceRussian"
                    placeholder="（Russian）"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
         </div>
        <br>
        <div class="UploadS">
        <el-form-item label="编号">
          <el-input v-model="tableDataTemp.numberOrder"
                    placeholder="编号"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
          <br>
        <el-form-item label="产品">
          <el-input v-model="tableDataTemp.product"
                    placeholder="产品"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(English)">
          <el-input v-model="tableDataTemp.productEnglish"
                    placeholder="English"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
         <el-form-item label="(Russian)">
          <el-input v-model="tableDataTemp.productRussian"
                    placeholder="Russian"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <br>
        <el-form-item label="过程">
          <el-input v-model="tableDataTemp.processUse"
                    placeholder="过程"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(English)">
          <el-input v-model="tableDataTemp.processUseEnglish"
                    placeholder="English"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(Russian)">
          <el-input v-model="tableDataTemp.processUseRussian"
                    placeholder="Russian"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        </div>
        <br>
        <div class="UploadS">
        <el-form-item label="特殊特性分类">
          <el-input v-model="tableDataTemp.characteristic"
                    placeholder="特殊特性分类"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
          <br>
        <el-form-item label="产品/过程规范/公差" >
          <el-input v-model="tableDataTemp.specification"
                    placeholder="产品/过程规范/公差"
                    type="textarea"
                    class="el-input"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <br>
        <el-form-item label="产品/过程规范/公差(English)">
          <el-input v-model="tableDataTemp.specificationEnglish"
                    placeholder="产品/过程规范/公差"
                    type="textarea"
                    class="el-input"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <br>
        <el-form-item label="产品/过程规范/公差(Russian)">
          <el-input v-model="tableDataTemp.specificationRussian"
                    placeholder="产品/过程规范/公差"
                    type="textarea"
                    class="el-input"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <br>
        <el-form-item label="评价/测量技术">
          <el-input v-model="tableDataTemp.measure"
                    placeholder="评价/测量技术"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(English)">
          <el-input v-model="tableDataTemp.measureEnglish"
                    placeholder="English"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(Russian)">
          <el-input v-model="tableDataTemp.measureRussian"
                    placeholder="Russian"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <br>
        <el-form-item label="容量">
          <el-input v-model="tableDataTemp.capacity"
                    placeholder="过程"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(English)">
          <el-input v-model="tableDataTemp.capacityEnglish"
                    placeholder="English"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(Russian)">
          <el-input v-model="tableDataTemp.capacityRussian"
                    placeholder="Russian"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <br>
        <el-form-item label="频率">
          <el-input v-model="tableDataTemp.frequency"
                    placeholder="过程"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(English)">
          <el-input v-model="tableDataTemp.frequencyEnglish"
                    placeholder="English"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(Russian)">
          <el-input v-model="tableDataTemp.frequencyRussian"
                    placeholder="Russian"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <br>
        <el-form-item label="控制方法">
          <el-input v-model="tableDataTemp.method"
                    placeholder="过程"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(English)">
          <el-input v-model="tableDataTemp.methodEnglish"
                    placeholder="English"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        <el-form-item label="(Russian)">
          <el-input v-model="tableDataTemp.methodRussian"
                    placeholder="Russian"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>
        </div>
        <br>
        <div class="UploadS">
          <el-form-item label="责任部门" prop="department" class="item">
            <el-select v-model="tableDataTemp.department" placeholder="请选择">
              <el-option
                  v-for="item in optionsD"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        <el-form-item
            label="反应计划"
            prop="reaction">
          <el-input v-model="tableDataTemp.reaction"
                    placeholder="（请输入数字）"
                    type="textarea"
                    :autosize="{ minRows: 1, maxRows: 4}"></el-input>
        </el-form-item>

        </div>
        <br><br>
        <el-form-item>
      <el-button type="primary" @click="submitForm('tableDataTemp')">提交</el-button>
      <el-button @click="resetForm('tableDataTemp')">重置</el-button>
      <el-button @click="dialogVisible=false">取消</el-button>
      </el-form-item>
    </el-form>
  </span>
  </el-dialog>

  <!--增加工序或产品的弹窗-->
  <el-dialog
      :title="titleMessage"
      :visible.sync="dialogVisibleOP"
      width="40%"
      :before-close="handleClose">
    <div>
      <el-form ref="form"  label-width="25%" style="width: 100%">
        <el-form-item label="车间名称：">
          <el-input  style="width: 100%" :disabled="true" v-model="parentParentLable"></el-input>
        </el-form-item>
        <el-form-item label="产品图号：">
          <el-input  style="width: 100%" :disabled="isDisadled" v-model="drawingUse"></el-input>
        </el-form-item>
        <el-form-item label="工序名：OP">
          <el-input  style="width: 100%" v-model="opUse"></el-input>
        </el-form-item>
        <br><br>
        <el-form-item>
          <el-button type="primary" @click="addOpDetermine">提交</el-button>
          <el-button @click="dialogVisibleOP = false">取消</el-button>
        </el-form-item>
      </el-form>
    </div>
  </el-dialog>

  <!--点击“检测频次”中的“编辑按钮，弹窗-->
  <el-dialog
      :title="titleMessage"
      :visible.sync="dialogVisibleTesting"
      width="80%"
      :before-close="handleClose">
    <div>
      <control-testing-utils
       :language-s="languageS"
       :workshop-chinese="workshopChinese"
       :workshop-english="workshopEnglish"
       :workshop-russian="workshopRussian"
       :click-id="clickId"
       :controlP="tableDataTemp"
       :table-data-testing-u="tableDataTestingU"
       :open-val="openVal"
       :drawing-p="parentLabel"
       :op-p="ChildrenLabel"></control-testing-utils>
    </div>
  </el-dialog>

</div>
</template>

<script>
import UseTree from "@/components/utils/UseTree.vue";
import ControlTestingUtils from "@/components/utils/controlTestingUtils.vue";

export default {
  name: "controlPlan",
  components: {
    ControlTestingUtils,
    UseTree
  },

  data() {
    //限制工序号不写，或者工序号为非数字
    var validateReaction =(rule,value,callback)=>{
      if(!value){
        return callback(new Error("工序号不能为空"))
      }else if (!/^\d+$/.test(value)){
        callback(new Error('请输入数值'))
      }else {
        callback()
      }
    }
    return {
      /*用在main中的变量数据*/
      //弹窗出的窗口中，进行部门选择
      optionsD: [{
        value: '品质管理科/Quality Management Department/Секция управления качеством',
        label: '品质管理科/Quality Management Department/Секция управления качеством'
      }, {
        value: '装配车间/Assembly workshop/сборочный цех',
        label: '装配车间/Assembly workshop/сборочный цех'
      }, {
        value: '机加车间/Machining workshop/Машиностроительный цех',
        label: '机加车间/Machining workshop/Машиностроительный цех'
      },{
        value: '物流科/Logistics Department/Отдел логистики',
        label: '物流科/Logistics Department/Отдел логистики'
      }],

      //记录列表显示数据的数组
       tableData: [
           {
        //记录主键ID
        id: null,
        //零件/过程编号
        processNumber: '',
        processNumberEnglish:'',
        processNumberRussian:'',
        //机器、夹具、装置、工装
        device: '',
        deviceEnglish:'',
        deviceRussian:'',
        //过程名称/操作描述
        operation: '',
        operationEnglish:'',
        operationRussian:'',
        //编号
        numberOrder: '',
        //产品
        product: '',
        productEnglish:'',
        productRussian:'',
        //过程
        processUse: '',
        processUseEnglish:'',
        processUseRussian:'',
        //特殊特性分类
        characteristic:'',
        //产品、过程规范、公差
        specification: '',
        specificationEnglish:'',
        specificationRussian:'',
        //评价、测量技术
        measure: '',
        measureEnglish:'',
        measureRussian:'',
        //容量
        capacity: '',
        capacityEnglish:'',
        capacityRussian:'',
        //频率
        frequency: '',
        frequencyEnglish:'',
        frequencyRussian:'',
        //控制方法
        method: '',
        methodEnglish:'',
        methodRussian:'',
        //责任部门
        department: '',
        departmentEnglish:'',
        departmentRussian:'',
        //反应计划
        reaction:0,
        //产品图号
        drawing: '',
        //工序号
        op: 0,
        //车间名称
        workshop:'',
        workshopEnglish:'',
        workshopRussian:'',
        //记录顺序用
        orderNumber:0,
       //记录删除标记
       deleteSign:1,
      }
        ],
      //记录需要修改的数据，以行为单位////传递给子组件，的孔子计划这一页点击行的所有数据
      tableDataTemp: {
        //记录主键ID
        id: null,
        //零件/过程编号
        processNumber: '',
        processNumberEnglish:'',
        processNumberRussian:'',
        //机器、夹具、装置、工装
        device: '',
        deviceEnglish:'',
        deviceRussian:'',
        //过程名称/操作描述
        operation: '',
        operationEnglish:'',
        operationRussian:'',
        //编号
        numberOrder: '',
        //产品
        product: '',
        productEnglish:'',
        productRussian:'',
        //过程
        processUse: '',
        processUseEnglish:'',
        processUseRussian:'',
        //特殊特性分类
        characteristic:'',
        //产品、过程规范、公差
        specification: '',
        specificationEnglish:'',
        specificationRussian:'',
        //评价、测量技术
        measure: '',
        measureEnglish:'',
        measureRussian:'',
        //容量
        capacity: '',
        capacityEnglish:'',
        capacityRussian:'',
        //频率
        frequency: '',
        frequencyEnglish:'',
        frequencyRussian:'',
        //控制方法
        method: '',
        methodEnglish:'',
        methodRussian:'',
        //责任部门
        department: '',
        departmentEnglish:'',
        departmentRussian:'',
        //反应计划
        reaction: 0,
        //产品图号
        drawing: '',
        //工序号
        op: 0,
        //车间名称
        workshop:'',
        workshopEnglish:'',
        workshopRussian:'',
        //记录顺序用
        orderNumber:0,
        //记录删除标记
        deleteSign:1,
      },

      //校验数据的对象
      tableDataTemprules:{
        reaction:[{validator:validateReaction,trigger:'blur'}],
      },
      //给频次检测组件传入数据，展现页面用
      tableDataTestingU: [{
        //主键
        id:-1,
        //车间名称（中文）
        workshop:'',
        //车间名称（英文）
        workshopEnglish:'',
        //车间名称（俄文）
        workshopRussian:'',
        //图号
        drawing:'',
        //工序号
        op:'',
        //记录检验项目
        project:'',
        //记录检验项目（英文）
        projectEnglish:'',
        //记录检验项目（俄文）
        projectRussian:'',
        //记录检验要求
        requirement:'',
        //记录检验要求（英文）
        requirementEnglish:'',
        //记录检验要求（俄文）
        requirementRussian:'',
        //记录检测类型
        typeTesting:'',
        //记录标准值
        standard:'',
        //记录上偏差
        ceiling:'',
        //记录下偏差
        lower:'',
        //frequency
        frequency:'',
        //记录实施部门
        department:'',
        //记录实施部门（英文）
        departmentEnglish:'',
        //记录实施部门（俄文）
        departmentRussian:'',
        //项目类型（1：代表控制计划项目，2：代表自行识别项目，3：代表控制计划加严项目）
        projectType:'',
        //关联控制计划的标记位
        controlTesting:'',
        //删除标记位（1：正常，0：删除）
        deleteSign:1,
        //记录顺序号
        orderNumber:0,
      },],
      //控制点击每一行的编辑时候用到
      dialogVisible:false,
      //添加工序、产品时用到
      dialogVisibleOP:false,
      //控制点击“频次检测”中“编辑”的弹窗
      dialogVisibleTesting:false,
      //记录用户选择的是哪些编辑类型，1：代表编辑，2：代表删除，3：代表向下插入，4：向上插入
      whatType:0,
      /*用在aside的变量数据*/
      //记录页面呈现的导航信息
      TreeList:[],
      //记录后台返回的三种语言的导航信息
      TreeListAll:[],
      //点击导航栏，用到的变量
      ChildrenLabel:'no',
      parentLabel:'no',
      parentParentLable:'no',
      //记录用户选择的语言，默认为中文
      languageS:"chinese",
      //记录当前点击的车间英文名字信息 //记录英文的车间名称，用作很多查询数据用并且传递给后端，用作后端的数据补充
      //车间名称
      workshopChinese:'',
      workshop:'',
      workshopEnglish:'',
      //记录当前点击的车间俄文名
      workshopRussian:'',
      //记录当前点击的车间中文名称
      //记录用户选择的数据的索引号。
      selectedIndexUse:0,
      //主窗口弹窗信息
      titleMessage:'',
      //在添加工序、产品中，判断产品框是否允许用户使用
      isDisadled:true,
      //接收用户输入的工序号
      opUse:'',
      //接收用户输入的产品号
      drawingUse:'',
      /*更换表格数据，作为选择语言用的变量*/
      //零件/过程编号
      processNumber: '',
      //机器、夹具、装置、工装
      device: '',
      //过程名称/操作描述
      operation: '',
      //编号
      numberOrder: '',
      //产品
      product: '',
      //过程
      processUse: '',
      //特殊特性分类
      characteristic:'',
      //产品、过程规范、公差
      specification: '',
      //评价、测量技术
      measure: '',
      //容量
      capacity: '',
      //频率
      frequency: '',
      //控制方法
      method: '',
      //责任部门
      department: '',
      //记录顺序用
      orderNumber:null,

      //传给子组件用，是单击行的作用的方式是查询控制计划中开启的各项控制项目查询用
      clickId:0,

      //openVal,当打开弹窗的时候，进行传递数据用
      openVal:''
    }
  },
  methods: {
    //点击主页上的“编辑”中的4个不同的项目，进行不同的反应
    handleEdit(scope,doe) {
      if (this.ChildrenLabel==='no'){
        alert("您未选择任何产品及工序，请选择后进行操作")
        return
      }
      //返回用户选择的类型
      this.whatType=doe
      //返回用户选择数据的index。
      this.selectedIndexUse=scope.$index
      //点击“编辑”中的“编辑”按钮，弹窗展现内容
      if (doe===1){
        //如果在没有选择任何工序的时候，弹出窗口，是进行插入操作的。
        if (this.tableData.length===1 && this.tableData[0].specification===''){
          alert("您现在选择的工序下无任何内容，将执行插入命令")
          this.titleMessage='您选择的是一个空工序，将进行插入命令\n同时，提示您，上方有空行，请更新空行'
          //打开的是一个空的弹窗
          this.tableDataTemp= {
            //记录主键ID
            id: 0,
                //零件/过程编号
                processNumber: '',
                processNumberEnglish:'',
                processNumberRussian:'',
                //机器、夹具、装置、工装
                device: '',
                deviceEnglish:'',
                deviceRussian:'',
                //过程名称/操作描述
                operation: '',
                operationEnglish:'',
                operationRussian:'',
                //编号
                numberOrder: '',
                //产品
                product: '',
                productEnglish:'',
                productRussian:'',
                //过程
                processUse: '',
                processUseEnglish:'',
                processUseRussian:'',
                //特殊特性分类
                characteristic: 0,
                //产品、过程规范、公差
                specification: '',
                specificationEnglish:'',
                specificationRussian:'',
                //评价、测量技术
                measure: '',
                measureEnglish:'',
                measureRussian:'',
                //容量
                capacity: '',
                capacityEnglish:'',
                capacityRussian:'',
                //频率
                frequency: '',
                frequencyEnglish:'',
                frequencyRussian:'',
                //控制方法
                method: '',
                methodEnglish:'',
                methodRussian:'',
                //责任部门
                department: '',
                departmentEnglish:'',
                departmentRussian:'',
                //反应计划
                reaction: 0,
                //产品图号
                drawing: '',
                //工序号
                op: 0,
                //车间名称
                workshop:'',
                workshopEnglish:'',
                workshopRussian:'',
                //记录顺序用
                orderNumber:0,
          }
          this.dialogVisible=true
        }
        else {
          //打开一个赋值本行的数据
          this.tableDataTemp=this.tableData[scope.$index]
          this.titleMessage="提示：您选择的操作为：编辑\n 将修改以下数据"
          this.dialogVisible=true
        }
      }else if (doe===3 ||doe===4){
        //打开一个空的弹窗
        this.tableDataTemp= {
          //记录主键ID
          id: 0,
          //零件/过程编号
          processNumber: '',
          processNumberEnglish:'',
          processNumberRussian:'',
          //机器、夹具、装置、工装
          device: '',
          deviceEnglish:'',
          deviceRussian:'',
          //过程名称/操作描述
          operation: '',
          operationEnglish:'',
          operationRussian:'',
          //编号
          numberOrder: '',
          //产品
          product: '',
          productEnglish:'',
          productRussian:'',
          //过程
          processUse: '',
          processUseEnglish:'',
          processUseRussian:'',
          //特殊特性分类
          characteristic: 0,
          //产品、过程规范、公差
          specification: '',
          specificationEnglish:'',
          specificationRussian:'',
          //评价、测量技术
          measure: '',
          measureEnglish:'',
          measureRussian:'',
          //容量
          capacity: '',
          capacityEnglish:'',
          capacityRussian:'',
          //频率
          frequency: '',
          frequencyEnglish:'',
          frequencyRussian:'',
          //控制方法
          method: '',
          methodEnglish:'',
          methodRussian:'',
          //责任部门
          department: '',
          departmentEnglish:'',
          departmentRussian:'',
          //反应计划
          reaction: 0,
          //产品图号
          drawing: '',
          //工序号
          op: 0,
          //车间名称
          workshop:'',
          workshopEnglish:'',
          workshopRussian:'',
          //记录顺序号，进行排序用
          orderNumber:0,
        }
        //把固定的字段赋值给tableDataTemp（车间名称，图号，工序号）
        this.tableDataTemp.workshop=this.tableData[0].workshop
        this.tableDataTemp.workshopEnglish=this.tableData[0].workshopEnglish
        this.tableDataTemp.workshopRussian=this.tableData[0].workshopRussian
        this.tableDataTemp.drawing=this.tableData[0].drawing
        this.tableDataTemp.op=this.tableData[0].op
        console.log(this.tableData[0].drawing)
        this.dialogVisible=true
        if (doe===3){
          this.titleMessage="提示：您选择的是向下插入行\n 将修改以下数据"
        }else {
          this.titleMessage="提示：您选择的是向上插入行\n 将修改以下数据"
        }
      }else if (doe===2){
        //打开一个赋值本行的数据
        this.tableDataTemp=this.tableData[scope.$index]
        this.titleMessage="提示：您选择的操作为：删除\n 将删除以下数据"
        this.dialogVisible=true
      }
    },
    //添加工序或产品,弹窗显示
    addOp(doe){
      //判断用户是否点击了某一个工序，如果没有点击，不允许操作
      if (this.ChildrenLabel==='no'){
        alert("未选择工序，请选择工序后操作")
        return
      }
      if (doe===1){
        this.titleMessage="你选择的是增加工序"
        this.isDisadled=true
        this.drawingUse=this.parentLabel
      }else if(doe===2){
        this.titleMessage="您选择的是增加产品"
        this.drawingUse=''
        this.isDisadled=false
      }
      this.dialogVisibleOP=true
    },
    //添加工序或产品，点击弹窗中的“提交”按钮
    addOpDetermine(){
      //如果用户没有写工序号、产品图号，直接提示
      if (this.opUse===''||this.drawingUse===''){
        alert("您未填写工序号或产品图号，请填写")
        return
      }
      //都是用插入行，进行判断用户是否选择的是增加工序
      if(this.titleMessage==='你选择的是增加工序'){
        //判断用户输入的工序号是否合法，是否重复
        if (this.opUse.toLowerCase().includes('op')){
          alert("请去除OP")
          return;
        }else {
          //判断写的工序号是不是重复
          for (let i = 0; i < this.TreeList.length; i++) {
            //找到用户选择的车间
            if (this.TreeList[i].label===this.parentParentLable){
              for (let j = 0; j <this.TreeList[i].children.length; j++) {
                //找到用户选择的产品
                if (this.TreeList[i].children[j].label===this.parentLabel){
                  //找用户是不是把工序号写重复了
                  for (let k = 0; k < this.TreeList[i].children[j].children.length; k++) {
                    //查找工序号是否重复
                    if(this.TreeList[i].children[j].children[k].label.slice(2)===this.opUse){
                      alert("您输入的工序号重复，请重新输入")
                      this.opUse=''
                      return;
                    }
                  }
                }
              }
            }
          }
        }
        //通过判断，可以执行添加
        //整理数据，需要把车间信息写入到临时的数据中。
        let treeA=[]
        for (let l = 0; l <this.TreeListAll.length; l++) {
          treeA.push(this.TreeListAll[l].label)
        }
        let index=treeA.indexOf(this.parentParentLable)
        if (index===-1){
          alert("系统出现异常，请联系管理员")
          return;
        }
          //找到中文\英文\俄文的车间名称
          let workshop
          let workshopEnglish
          let workshopRussian
          if (this.languageS==='chinese'){
            workshop=this.parentParentLable
            workshopEnglish=treeA[index-treeA.length/3]
            workshopRussian=treeA[index+treeA.length/3]
          }
          else if (this.languageS==='english'){
            workshop=treeA[index+treeA.length/3]
            workshopEnglish=this.parentParentLable
            workshopRussian=treeA[index+treeA.length/3*2]
          }
          else if (this.languageS==='russian'){
            workshop=treeA[index-treeA.length/3]
            workshopEnglish=treeA[index-treeA.length/3*2]
            workshopRussian=this.parentParentLable
          }
          let tempData={
            //零件/过程编号
            processNumber: '请输入',
            processNumberEnglish:'请输入',
            processNumberRussian:'请输入',
            //机器、夹具、装置、工装
            device: '请输入',
            deviceEnglish:'请输入',
            deviceRussian:'请输入',
            //过程名称/操作描述
            operation: '请输入',
            operationEnglish:'请输入',
            operationRussian:'请输入',
            //编号
            numberOrder: '请输入',
            //产品
            product: '请输入',
            productEnglish:'请输入',
            productRussian:'请输入',
            //过程
            processUse: '请输入',
            processUseEnglish:'请输入',
            processUseRussian:'请输入',
            //特殊特性分类
            characteristic:'请输入',
            //产品、过程规范、公差
            specification: '请输入',
            specificationEnglish:'请输入',
            specificationRussian:'请输入',
            //评价、测量技术
            measure: '请输入',
            measureEnglish:'请输入',
            measureRussian:'请输入',
            //容量
            capacity: '请输入',
            capacityEnglish:'请输入',
            capacityRussian:'请输入',
            //频率
            frequency: '请输入',
            frequencyEnglish:'请输入',
            frequencyRussian:'请输入',
            //控制方法
            method: '请输入',
            methodEnglish:'请输入',
            methodRussian:'请输入',
            //责任部门
            department: '请输入',
            departmentEnglish:'请输入',
            departmentRussian:'请输入',
            //反应计划
            reaction: 0,
            //产品图号
            drawing: this.parentLabel,
            //工序号
            op: this.opUse,
            //车间名称
            workshop:workshop,
            workshopEnglish:workshopEnglish,
            workshopRussian:workshopRussian,
            //记录顺序用
            orderNumber:0,
            //记录删除标记,1代表显示，0代表不显示
            deleteSign:1,
          }
          //进行插入行
          //向后端发送请求，把数据发给后端进行保存。
          this.$request.post('/controlPlanVoidInsert',tempData).then(result=>{
            console.log(result)
            location.reload()
            alert("插入成功，数据已更新")
          })
          this.dialogVisibleOP=false


      }
      else if (this.titleMessage==='您选择的是增加产品'){
        //判断用户输入的工序号是否合法，是否重复
        if (this.opUse.toLowerCase().includes('op')){
          alert("请去除OP")
        }else {
          //判断条件，看产品号是否重复
          for (let i = 0; i < this.TreeList.length; i++) {
            //找到用户选择的车间
            if (this.TreeList[i].label===this.parentParentLable){
              for (let j = 0; j <this.TreeList[i].children.length; j++) {
                //找到用户选择的产品,判断是不是重复了，如果重复了，提示用户
                if (this.TreeList[i].children[j].label.toLowerCase()===this.drawingUse.toLowerCase()) {
                  alert('您输入的产品号重复，请重新输入')
                  return;
                }else {
                  //确认不重复后执行
                  //整理数据，需要把车间信息写入到临时的数据中。
                  let treeA=[]
                  for (let l = 0; l <this.TreeListAll.length; l++) {
                    treeA.push(this.TreeListAll[l].label)
                  }
                  let index=treeA.indexOf(this.parentParentLable)
                  if (index===-1){
                    alert("系统出现异常，请联系管理员")
                  }else {
                    //找到中文\英文\俄文的车间名称
                    let workshop
                    let workshopEnglish
                    let workshopRussian
                    if (this.languageS==='chinese'){
                      workshop=this.parentParentLable
                      workshopEnglish=treeA[index-treeA.length/3]
                      workshopRussian=treeA[index+treeA.length/3]
                    }
                    else if (this.languageS==='english'){
                      workshop=treeA[index+treeA.length/3]
                      workshopEnglish=this.parentParentLable
                      workshopRussian=treeA[index+treeA.length/3*2]
                    }
                    else if (this.languageS==='russian'){
                      workshop=treeA[index-treeA.length/3]
                      workshopEnglish=treeA[index-treeA.length/3*2]
                      workshopRussian=this.parentParentLable
                    }
                    let tempData={
                      //零件/过程编号
                      processNumber: '请输入',
                      processNumberEnglish:'请输入',
                      processNumberRussian:'请输入',
                      //机器、夹具、装置、工装
                      device: '请输入',
                      deviceEnglish:'请输入',
                      deviceRussian:'请输入',
                      //过程名称/操作描述
                      operation: '请输入',
                      operationEnglish:'请输入',
                      operationRussian:'请输入',
                      //编号
                      numberOrder: '请输入',
                      //产品
                      product: '请输入',
                      productEnglish:'请输入',
                      productRussian:'请输入',
                      //过程
                      processUse: '请输入',
                      processUseEnglish:'请输入',
                      processUseRussian:'请输入',
                      //特殊特性分类
                      characteristic:'请输入',
                      //产品、过程规范、公差
                      specification: '请输入',
                      specificationEnglish:'请输入',
                      specificationRussian:'请输入',
                      //评价、测量技术
                      measure: '请输入',
                      measureEnglish:'请输入',
                      measureRussian:'请输入',
                      //容量
                      capacity: '请输入',
                      capacityEnglish:'请输入',
                      capacityRussian:'请输入',
                      //频率
                      frequency: '请输入',
                      frequencyEnglish:'请输入',
                      frequencyRussian:'请输入',
                      //控制方法
                      method: '请输入',
                      methodEnglish:'请输入',
                      methodRussian:'请输入',
                      //责任部门
                      department: '请输入',
                      departmentEnglish:'请输入',
                      departmentRussian:'请输入',
                      //反应计划
                      reaction: 0,
                      //产品图号
                      drawing: this.drawingUse,
                      //工序号
                      op: this.opUse,
                      //车间名称
                      workshop:workshop,
                      workshopEnglish:workshopEnglish,
                      workshopRussian:workshopRussian,
                      //记录顺序用
                      orderNumber:0,
                      //记录删除标记,1代表显示，0代表不显示
                      deleteSign:1,
                    }
                    //进行插入行
                    //向后端发送请求，把数据发给后端进行保存。
                    this.$request.post('/controlPlanVoidInsert',tempData).then(result=>{
                      console.log(result)
                      location.reload()
                      alert("插入成功，数据已更新")
                    })
                    this.dialogVisibleOP=false
                }
                }
              }
            }
        }
      }
      }
    },
    //语言的判断过程
    LanguageSelection(type){
      //当选择的是英文的时候
      if (type==='english'){
            /*更换表格数据，作为选择语言用的变量*/
            //零件/过程编号
            this.processNumber='processNumberEnglish'
            //机器、夹具、装置、工装
            this.device='deviceEnglish'
            //过程名称/操作描述
            this.operation='operationEnglish'
            //编号
            this.numberOrder='numberOrderEnglish'
            //产品
            this.product='productEnglish'
            //过程
            this.processUse='processUseEnglish'
            //产品、过程规范、公差
            this.specification='specificationEnglish'
            //评价、测量技术
            this.measure='measureEnglish'
            //容量
            this.capacity='capacityEnglish'
            //频率
            this.frequency='frequencyEnglish'
            //控制方法
            this.method='methodEnglish'
            //责任部门
            this.department='departmentEnglish'
            //车间名称
            this.workshop='workshopEnglish'

      } else if (type==='chinese'){
        /*更换表格数据，作为选择语言用的变量*/
        //零件/过程编号
        this.processNumber='processNumber'
        //机器、夹具、装置、工装
        this.device='device'
        //过程名称/操作描述
        this.operation='operation'
        //编号
        this.numberOrder='numberOrder'
        //产品
        this.product='product'
        //过程
        this.processUse='processUse'
        //产品、过程规范、公差
        this.specification='specification'
        //评价、测量技术
        this.measure='measure'
        //容量
        this.capacity='capacity'
        //频率
        this.frequency='frequency'
        //控制方法
        this.method='method'
        //责任部门
        this.department='department'
        //车间名称
        this.workshop='workshop'
      }else if (type==='russian'){
        /*更换表格数据，作为选择语言用的变量*/
        //零件/过程编号
        this.processNumber='processNumberRussian'
        //机器、夹具、装置、工装
        this.device='deviceRussian'
        //过程名称/操作描述
        this.operation='operationRussian'
        //编号
        this.numberOrder='numberOrderRussian'
        //产品
        this.product='productRussian'
        //过程
        this.processUse='processUseRussian'
        //产品、过程规范、公差
        this.specification='specificationRussian'
        //评价、测量技术
        this.measure='measureRussian'
        //容量
        this.capacity='capacityRussian'
        //频率
        this.frequency='frequencyRussian'
        //控制方法
        this.method='methodRussian'
        //责任部门
        this.department='departmentRussian'
        //车间名称
        this.workshop='workshopRussian'
      }
    },
    //接收UseTree单击了导航栏后返回父组件的数据，用在根据导航栏筛选作业指导书的步骤，并显示在列表中。
    TreeClick(data,node){
      //判断点击的字符有没有“OP”,如果有，说明已经点击到了第三次，可以进行赋值了，如果没有，把父级的设置为“no”
      if (data.label.includes("OP")){
        const parentNode=node.parent
        this.ChildrenLabel=data.label
        this.parentLabel=parentNode.label
        this.parentParentLable=node.parent.parent.label
        /*向后端发送请求，筛选出对应工序的类别*/
        //需要传输3个参数，一个是工序号，一个是产品图号，一个是车间名称，涉及到3个语言的，统一传递英文内容,本次请求，只涉及到车间名称是需要查询因为的；
        //新建一个变量，记录英文的车间名称
        let workshopS=''
        //新建一个变量，记录所有的三种语言的名称
        let workshopAll=[]
        //记录索引值
        let index
        for (let i = 0; i < this.TreeListAll.length; i++) {
          workshopAll.push(this.TreeListAll[i].label)
        }
        if (this.languageS==='english'){
          workshopS=node.parent.parent.label
          this.workshopEnglish=workshopS
          this.workshopChinese=workshopAll.indexOf(node.parent.parent.label)
          this.workshopChinese=workshopAll[index+workshopAll.length/3]
          this.workshopRussian=workshopAll[index+workshopAll.length/3*2]
        }else if (this.languageS==='chinese'){
          //找到现在车间名称在整个车间名称中的位置
          index=workshopAll.indexOf(node.parent.parent.label)
          if (index!==-1){
            //中文的目录排在中间，需要向上去找英文的名称，找到的索引减去1/3的整个车间长度即为对应的车间名称
            this.workshopEnglish=workshopAll[index-workshopAll.length/3]
            this.workshopChinese=workshopAll[index]
            this.workshopRussian=workshopAll[index+workshopAll.length/3]
          }else {
            alert("程序有异常，请联系管理员")
          }
        }else if (this.languageS==='russian'){
          //找到现在车间名称在整个车间名称中的位置
          index=workshopAll.indexOf(node.parent.parent.label)
          if (index!==-1){
            //中文的目录排在中间，需要向上去找英文的名称，找到的索引减去2/3的整个车间长度即为对应的车间名称
            this.workshopEnglish=workshopAll[index-(workshopAll.length/3)*2]
            this.workshopChinese=workshopAll[index-workshopAll.length/3]
            this.workshopRussian=workshopAll[index]
          }else {
            alert("程序有异常，请联系管理员")
          }
        }
        //把导航中的“OP”去掉，给后端传递数据
        let numberStr = this.ChildrenLabel.slice(2)
        //向后端发送请求，发三个参数
         this.$request.post('/controlPlanList',{
           op:numberStr,
           drawing:this.parentLabel,
            workshopEnglish:this.workshopEnglish,
           }).then(result=>{
             this.tableData=result.data
           console.log('输出到这里了:',this.tableData)
           //根据不同的语言，展现数据
            if (this.languageS==='chinese'){
              this.LanguageSelection('chinese')
            }else if (this.languageS==='english'){
              this.LanguageSelection('english')
            }else if (this.languageS==='russian'){
              this.LanguageSelection('russian')
            }
         })
      }else {
        this.parentParentLable='no'
        this.parentLabel='no'
        this.ChildrenLabel='no'
      }

    },
    //弹窗点击关闭时候的提示
    handleClose(done) {
      this.$confirm('确认关闭？')
          .then(_ => {
            console.log(_)
            done();
          })
          .catch(_ => {
            console.log(_)
          });
    },
    //点击弹出的窗口“提交”按钮后的动作，向后端发送数据，进行保存
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          //判断是否为空序，如果是，所有的执行插入过程
          if (this.tableData.length===1 && this.tableData[0].id===null){
            console.log("判断是否为空的一条，如果是空的，需要插入1条")
            //因为是第一条，因此将顺序号写为0
            this.tableDataTemp.orderNumber=0
            //向后端发送数据
            this.$request.post("/controlPlanVoidInsert",this.tableDataTemp).then(result=>{
              this.dialogVisible=false
              alert(result.data)
            })
            this.dialogVisible=false
          } else {
            if (this.whatType===1){
              console.log("执行到这里了")
              //编辑操作，不需要修改顺序号
              //执行修改一行的请求，根据id实现
              console.log(this.tableDataTemp)
              this.$request.put("/controlPlanVoidPut",this.tableDataTemp).then(rusult=>{
                //修改成功，刷新列表
                this.tableData=rusult.data
                console.log(this.tableData)
                this.LanguageSelection(this.languageS)
                this.dialogVisible=false
                alert("保存成功并刷新")
              })
              this.dialogVisible=false
            }
            else if (this.whatType===3){

              //执行的是向下插入操作，第一步对全体数据插入到数据中。
              //添加数据前，先将id设置为null
              this.tableDataTemp.id=null
              //把删除标记位设计为1
              this.tableDataTemp.deleteSign=1
              this.tableData.splice(this.selectedIndexUse+1,0,this.tableDataTemp)
              //重新做排序的顺序号
              for (let i = 0; i < this.tableData.length; i++) {
                this.tableData[i].orderNumber=i
                //为了保险，把所有循环的删除标记位都设置为1
                this.tableData[i].deleteSign=1

              }
              //向后端发送请求，把数据发给后端进行保存。
              this.$request.post('/controlPlanInsert',this.tableData).then(result=>{
                console.log(result.data)
                alert("插入成功，数据已更新")
              })
              this.dialogVisible=false
            }
            else if (this.whatType===4){
              //执行的是向上插入操作，第一步对全体数据插入到数据中。
              //添加数据前，先将id设置为null
              this.tableDataTemp.id=null
              this.tableData.splice(this.selectedIndexUse,0,this.tableDataTemp)
              //重新做排序的顺序号
              for (let i = 0; i < this.tableData.length; i++) {
                this.tableData[i].orderNumber=i
              }
              //向后端发送请求，把数据发给后端进行保存。
              this.$request.post('/controlPlanInsert',this.tableData).then(result=>{
                console.log(result.data)
                alert("插入成功，数据已更新")
              })
              this.dialogVisible=false
            }
            else if (this.whatType===2){
              //执行删除操作，本次删除设置为设立标记位，不进行真正删除，执行修改步骤，将标记位修改为0
              this.tableDataTemp.deleteSign=0
              this.$request.put("/controlPlanVoidPut",this.tableDataTemp).then(rusult=>{
                //修改成功，刷新列表
                this.tableData=rusult.data
                this.LanguageSelection(this.languageS)
                this.dialogVisible=false
                alert("保存成功并刷新")
              })
            }
          }
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },

    //点击“频次检测”中的"编辑"
    testing(scopeTesting,doe){
      if (this.ChildrenLabel==='no'){
        alert("请选择工序")
      }else {
        if (doe===1){
          //向后端请求数据,查询数据
          //通过英文名称查询，找到英文的车间名称
          this.$request.post("/controlTestingListByclickId",{
            workshopEnglish:this.workshopEnglish,
            drawing:this.parentLabel,
            op:this.ChildrenLabel,
            controlTesting:scopeTesting.row.id
          }).then(result=>{
            if (result.code===401){
              this.$router.push('UserLogin')
              alert("您未登录，请登录")
            }else{
              this.tableDataTestingU=result.data
              if (this.tableDataTestingU.length===0){
                this.tableDataTestingU.push({
                  //主键
                  id:-1,
                  //车间名称（中文）
                  workshop:'',
                  //车间名称（英文）
                  workshopEnglish:'',
                  //车间名称（俄文）
                  workshopRussian:'',
                  //图号
                  drawing:'',
                  //工序号
                  op:'',
                  //记录检验项目
                  project:'请插入',
                  //记录检验项目（英文）
                  projectEnglish:'请插入',
                  //记录检验项目（俄文）
                  projectRussian:'请插入',
                  //记录检验要求
                  requirement:'请插入',
                  //记录检验要求（英文）
                  requirementEnglish:'请插入',
                  //记录检验要求（俄文）
                  requirementRussian:'请插入',
                  //记录检测类型
                  typeTesting:'请插入',
                  //记录标准值
                  standard:'请插入',
                  //记录上偏差
                  ceiling:'请插入',
                  //记录下偏差
                  lower:'请插入',
                  //frequency
                  frequency:'请插入',
                  //记录实施部门
                  department:'请插入',
                  //记录实施部门（英文）
                  departmentEnglish:'请插入',
                  //记录实施部门（俄文）
                  departmentRussian:'请插入',
                  //项目类型（1：代表控制计划项目，2：代表自行识别项目，3：代表控制计划加严项目）
                  projectType:'请插入',
                  //关联控制计划的标记位
                  controlTesting:'请插入'
                })
              }
              //传递数据,把点击的数据传递给子组件
              this.tableDataTemp=scopeTesting.row
              //传递点击行的ID，后端将用
              this.clickId=scopeTesting.row.id
              console.log(this.clickId)
              this.openVal=''
              //打开展现的行内容
              this.dialogVisibleTesting=true
              //设定1S后，触发
              setTimeout(() => {
                // 这里是你要在定时器触发时执行的代码
                this.openVal='open'
                // 需要注意的是，由于这个定时器只设置了一次，所以它只会在指定的时间后执行一次
              }, 500);
            }
          }).catch(error=>{
            alert(error)
          })
        }

      }

    },

    //点击重置功能
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },

    languageSelectChinese(){
      this.languageS="chinese"
      this.TreeList=this.TreeListAll.slice(this.TreeListAll.length/3,this.TreeListAll.length/3*2)
      this.LanguageSelection('chinese')
    },
    //当选择语言为俄文时
    languageSelectRussian(){
      this.languageS="russian"
      this.TreeList=this.TreeListAll.slice(this.TreeListAll.length/3*2,this.TreeListAll.length)
      this.LanguageSelection('russian')
    },
    //当选择语言为英语时
    languageSelectEnglish(){
      this.languageS="english"
      this.TreeList=this.TreeListAll.slice(0,this.TreeListAll.length/3)
      this.LanguageSelection('english')
    },
  },
  watch:{

  },
  mounted() {
    //用分装axios请求发送，并且带有头部信息
    this.$request.post("/controlPlanTreeList").then(result=>{
      //判断，如果登录异常，跳转到登录页面
      if (result.code === 401){
        this.$router.push('UserLogin')
        alert("您未登录，请登录")
      }else {
        this.TreeListAll=result.data;
        if (this.languageS==="chinese"){
          this.TreeList=this.TreeListAll.slice(this.TreeListAll.length/3,this.TreeListAll.length/3*2)
        }
        this.parentLabel='no'
        this.ChildrenLabel='no'
      }
    })
  }
}
</script>

<style scoped>
/* 主体左侧的工作步骤栏用到的数据包围的div的样式*/

.el-footer {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  border-left-color: white;
  border-top: white;
}

.el-aside {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  height: 89vh;
}

.el-main {
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-left-color: white;
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
}

.el-input {
  width: 700px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

.UploadS{
  border-width: 1px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为虚线 */
  padding: 10px; /* 添加内边距 */
}
.headMain{
  color: #ffffff; /* 设置字体颜色为红色 */
  font-size: 18px;
}
.center-text {
  /* 使用 margin-left 和 margin-right auto 来实现居中效果 */
  margin-left: auto;
  margin-right: auto;
  /* 注意：如果 header 内只有这两个元素，你可能不需要 margin-right: auto */
}
</style>